<?php

/**
 * This is the model class for table "travel_build_rule".
 *
 * The followings are the available columns in table 'travel_build_rule':
 * @property integer $id ID
 * @property integer $goods_id Goods
 * @property string $start_time Start Time
 * @property string $end_time End Time
 * @property string $build_type Build Type
 * @property integer $end_type End Type
 * @property string $by_week By Week
 * @property integer $by_day By Day
 * @property string $by_date By Date
 */
class TravelBuildRule extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return TravelBuildRule the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.TravelBuildRuleMetadata';
	}
	
	protected function beforeValidate() {
		$this->by_day = empty($this->by_day) ? 1 : $this->by_day;
		return parent::beforeValidate();
	}
}